package OOday02;

/*public class HomeWork {
  public static void main(String[] args) {
        Dog dog=new Dog("柯基",3,"棕色");
        dog.Eat("小狗");
        dog.Drink("小狗");
        dog.LookHome("小狗");
        Chicken ji=new Chicken("蔡徐坤",23,"蓝色");
        ji.Eat("小鸡");
        ji.Drink("小鸡");
        ji.MakeAgge("小鸡");
        Fish fish=new Fish("金金",1,"金色");
        fish.Eat("小鱼");
        fish.Drink("小鱼");
    }
}
class Animal {
    String name;
    int age;
    String color;
    Animal(String name,int age,String color){
        this.name=name;
        this.age=age;
        this.color=color;
    }
    void Drink(String name1){
        System.out.println("一只"+age+"岁的"+color+name1+"叫"+name+"正在喝水...");
    }
    void Eat(String name1){
        System.out.println("一只"+age+"岁的"+color+name1+"叫"+name+"正在吃饭...");
    }
}
class Dog extends Animal{
    Dog(String name,int age,String color){
        super(name,age,color);
    }
    void Eat(String name1) {
        System.out.println("一只"+age+"岁的"+color+name1+"叫"+name+"正在吃狗粮...");
      }

    void LookHome(String name1){
        System.out.println("一只"+age+"岁的"+color+name1+"叫"+name+"正在看家...");
    }
}
class Chicken extends Animal{
    Chicken(String name,int age,String color){
        super(name,age,color);
    }
    void Eat(String name1){
        System.out.println("一只"+age+"岁的"+color+name1+"叫"+name+"正在吃小米...");
    }
    void MakeAgge(String name1){
        System.out.println("一只"+age+"岁的"+color+name1+"叫"+name+"正在下蛋...");
    }
}
class Fish extends Animal{
    Fish(String name,int age,String color){
        super(name,age,color);
    }
}

 */
public class HomeWork {
  public static void main(String[] args) {
        Dog dog=new Dog("柯基",3,"棕色");
        dog.Eat("小狗");
        dog.Drink("小狗");
        dog.LookHome("小狗");
        Chicken ji=new Chicken("蔡徐坤",23,"蓝色");
        ji.Eat("小鸡");
        ji.Drink("小鸡");
        ji.MakeAgge("小鸡");
        Fish fish=new Fish("金金",1,"金色");
        fish.Eat("小鱼");
        fish.Drink("小鱼");
        fish.swim();
    }
}
abstract class Animal {
    String name;
    int age;
    String color;
    abstract void Eat(String name1);
    Animal(String name,int age,String color){
        this.name=name;
        this.age=age;
        this.color=color;
    }
    void Drink(String name1){
        System.out.println("一只"+age+"岁的"+color+name1+"叫"+name+"正在喝水...");
    }
}
class Dog extends Animal{
    Dog(String name,int age,String color){
        super(name,age,color);
    }
    void Eat(String name1) {
        System.out.println("一只"+age+"岁的"+color+name1+"叫"+name+"正在吃狗粮...");
      }

    void LookHome(String name1){
        System.out.println("一只"+age+"岁的"+color+name1+"叫"+name+"正在看家...");
    }
}
class Chicken extends Animal{
    Chicken(String name,int age,String color){
        super(name,age,color);
    }
    void Eat(String name1){
        System.out.println("一只"+age+"岁的"+color+name1+"叫"+name+"正在吃小米...");
    }
    void MakeAgge(String name1){
        System.out.println("一只"+age+"岁的"+color+name1+"叫"+name+"正在下蛋...");
    }
}
class Fish extends Animal implements Inter{
    Fish(String name,int age,String color){
        super(name,age,color);
    }
    void Eat(String name1){
        System.out.println("一只"+age+"岁的"+color+name1+"叫"+name+"正在吃鱼粮...");
    }
    public void swim() {
        System.out.println("小坤坤");
    }
}
interface Inter{
    void swim();
}
